/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.ventas.modelo;

import isd.general.modelo.GR_Moneda;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "VTTLCR",schema = "dbo")
public class VT_LimiteDeCreditoVenta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    //Codigo limite de credito
    @Column(name = "VTTLCR_CODCRD", nullable = false, length = 6)
    private String codcrd;
    //Descripcion de limite de credito
    @Basic(optional = false)
    @Column(name = "VTTLCR_DESCRP", nullable = false, length = 60)
    private String descrp;
    //Importe de limite de credito
    @Basic(optional = false)
    @Column(name = "VTTLCR_PORCEN", nullable = false, precision = 18, scale = 2)
    private BigDecimal porcen;

    @JoinColumn(name = "VTTLCR_CODCOF", referencedColumnName = "GRTCOF_CODCOF", nullable = false, insertable=false, updatable=false)
    @ManyToOne
    private GR_Moneda coeficienteDeExpresion;
   
    //Trabaja con control de vencimiento
    @Column(name = "VTTLCR_TRAVEN")
    private Character traven;

    //Cantidad de dias (Minimo)
    @Column(name = "VTTLCR_DIAMIN")
    private Short diamin;
    
    //Porcentaje minimo
    @Column(name = "VTTLCR_PORMIN", precision = 15, scale = 7)
    private BigDecimal pormin;

    //Estructura de riesgo crediticio
    @Column(name = "VTTLCR_RIECRE", length = 6)
    private String vttlcrRiecre;

    //Ver detalle de compocision de riesgo
    @Column(name = "VTTLCR_VERDET")
    private Character vttlcrVerdet;
    @Lob
    @Column(name = "VTTLCR_SQLVEN", length = 2147483647)
    private String sqlven;
    @Lob
    @Column(name = "VTTLCR_SQLFAC", length = 2147483647)
    private String sqlfac;
    @Lob
    @Column(name = "VTTLCR_SQLTES", length = 2147483647)
    private String sqltes;
    @Lob
    @Column(name = "VTTLCR_SQLVAV", length = 2147483647)
    private String sqlvav;
    @Lob
    @Column(name = "VTTLCR_SQLVVE", length = 2147483647)
    private String sqlvve;

    @Column(name = "VTTLCR_DEBAJA")
    private Character debaja;

    public VT_LimiteDeCreditoVenta() {
    }

    public VT_LimiteDeCreditoVenta(String codcrd) {
        this.codcrd = codcrd;
    }

    public VT_LimiteDeCreditoVenta(String codcrd, String descrp, BigDecimal porcen) {
        this.codcrd = codcrd;
        this.descrp = descrp;
        this.porcen = porcen;
    }

    public String getCodcrd() {
        return codcrd;
    }

    public void setCodcrd(String codcrd) {
        this.codcrd = codcrd;
    }

    public GR_Moneda getCoeficienteDeExpresion() {
        return coeficienteDeExpresion;
    }

    public void setCoeficienteDeExpresion(GR_Moneda coeficienteDeExpresion) {
        this.coeficienteDeExpresion = coeficienteDeExpresion;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public Short getDiamin() {
        return diamin;
    }

    public void setDiamin(Short diamin) {
        this.diamin = diamin;
    }

    public BigDecimal getPorcen() {
        return porcen;
    }

    public void setPorcen(BigDecimal porcen) {
        this.porcen = porcen;
    }

    public BigDecimal getPormin() {
        return pormin;
    }

    public void setPormin(BigDecimal pormin) {
        this.pormin = pormin;
    }

    public String getSqlfac() {
        return sqlfac;
    }

    public void setSqlfac(String sqlfac) {
        this.sqlfac = sqlfac;
    }

    public String getSqltes() {
        return sqltes;
    }

    public void setSqltes(String sqltes) {
        this.sqltes = sqltes;
    }

    public String getSqlvav() {
        return sqlvav;
    }

    public void setSqlvav(String sqlvav) {
        this.sqlvav = sqlvav;
    }

    public String getSqlven() {
        return sqlven;
    }

    public void setSqlven(String sqlven) {
        this.sqlven = sqlven;
    }

    public String getSqlvve() {
        return sqlvve;
    }

    public void setSqlvve(String sqlvve) {
        this.sqlvve = sqlvve;
    }

    public Character getTraven() {
        return traven;
    }

    public void setTraven(Character traven) {
        this.traven = traven;
    }

    public String getVttlcrRiecre() {
        return vttlcrRiecre;
    }

    public void setVttlcrRiecre(String vttlcrRiecre) {
        this.vttlcrRiecre = vttlcrRiecre;
    }

    public Character getVttlcrVerdet() {
        return vttlcrVerdet;
    }

    public void setVttlcrVerdet(Character vttlcrVerdet) {
        this.vttlcrVerdet = vttlcrVerdet;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final VT_LimiteDeCreditoVenta other = (VT_LimiteDeCreditoVenta) obj;
        if ((this.codcrd == null) ? (other.codcrd != null) : !this.codcrd.equals(other.codcrd)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 11 * hash + (this.codcrd != null ? this.codcrd.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.LimiteDeCreditoVenta[vttlcrCodcrd=" + codcrd + "]";
    }

}
